package com.roc.template.cloud.factory;

import com.roc.template.cloud.CloudConfig;
import com.roc.template.cloud.constant.AccessTokenType;
import com.roc.template.cloud.factory.impl.AppAccessToken;
import com.roc.template.cloud.factory.impl.FileAccessToken;
import com.roc.template.cloud.factory.impl.ResGroupAccessToken;
import com.roc.template.cloud.factory.impl.TeamAccessToken;

/**
 * @ClassName AccessTokenFactory
 * @Description: TODO
 * @Author Administrator
 * @Date 2020/7/17 14 00
 * @Version V1.0
 **/
public class AccessTokenFactory {


    public static AccessToken getInstance(AccessTokenType accessTokenType, CloudConfig cloudConfig) {
        switch (accessTokenType) {
            case APP:
                return new AppAccessToken(cloudConfig);
            case TEAM:
                return new TeamAccessToken(cloudConfig);
            case RESGROUPSECRET:
                return new ResGroupAccessToken(cloudConfig);
            case FILE:
                return new FileAccessToken(cloudConfig);
                default:
                    return null;
        }
    }

}
